#include "fx_distortion.h"
#include "ui_fx_distortion.h"

fx_distortion::fx_distortion(QWidget *parent) :
    fx_basic(parent),
    ui(new Ui::fx_distortion)
{
    ui->setupUi(this);
}

fx_distortion::~fx_distortion()
{
    delete ui;
}

void fx_distortion::gain(int value)
{
    ui->label_gain->setText(QString::number(value) + " dB");
}

void fx_distortion::edge(int value)
{
    ui->label_edge->setText(QString::number(value) + "%");
}

void fx_distortion::center(int value)
{
    ui->label_center->setText(QString::number(value) + " Hz");
}

void fx_distortion::width(int value)
{
     ui->label_width->setText(QString::number(value) + " Hz");
}

void fx_distortion::filter(int value)
{
     ui->label_filter->setText(QString::number(value) + " Hz");
}

void fx_distortion::addFX()
{
    BASS_DX8_DISTORTION* result = new BASS_DX8_DISTORTION();
    result->fEdge = ui->horizontalSlider_edge->value();
    result->fGain = ui->horizontalSlider_gain->value();
    result->fPostEQBandwidth = ui->horizontalSlider_width->value();
    result->fPostEQCenterFrequency = ui->horizontalSlider_center->value();
    result->fPreLowpassCutoff = ui->horizontalSlider_filter->value();
    emit apply(BASS_FX_DX8_DISTORTION, result);
}
